<include file="Common@Backend/header" />

    <!-- page heading start-->
    <div class="page-heading">
        <h3>
            {$breadcrumb.A}
        </h3>
        <ul class="breadcrumb">
            <li>
                {$breadcrumb.M}
            </li>
            <li>
                {$breadcrumb.C}
            </li>
            <li class="active"> {$breadcrumb.A}  </li>
        </ul>
    </div>
    <!-- page heading end-->
    
    <!--body wrapper start-->
    <div class="wrapper">
        <div class="row">
            <div class="col-sm-12">
                <section class="panel">
                    <header class="panel-heading">
                        {$title}
                    </header>
                    <div class="panel-body">
                        <div class="clearfix">
                            <!-- <div class="btn-group">
                                <a class="btn btn-primary" href="{$addNew}">
                                   <i class="fa fa-plus"> {$addText} </i>
                                </a>
                            </div> -->
                            <notempty name="back">
                            <div class="btn-group">
                                <a class="btn btn-primary" href="{$back}">
                                   <i class="fa fa-reply"> 返回 </i>
                                </a>
                            </div>
                            </notempty>
                        </div>
                        <div class="space15"></div>
                        <section id="unseen" style="margin-top: 15px;">
                                <div>
                                    <a class="order-style all">所有订单</a><a class="order-style ing">待付款订单</a><a class="order-style ed">已付款订单</a><a class="order-style past">无效订单</a>
                                </div>
                                <div>&nbsp;</div>
                                <table class="table table-bordered table-striped table-condensed table-ing" style="display: none;">
                                    <thead>
                                    <tr><th colspan="6">未付款订单<a style="color: red;">（点击订单号查看详情）</a></th></tr>
                                    <tr>
                                        <th width="20%" align="center">订单号</th>
                                        <th width="25%" align="center">购买商品</th>
                                        <th width="25%" align="center">订单地址</th>
                                        <th width="10%" align="center">总价</th>
                                        <th width="10%" align="center">取消订单</th>
                                        
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <foreach name="order" item="value">
                                            <php>if($value['status']==="待付款"){</php>
                                                <tr>
                                                    <td><a href="" alt="点击查看详情！" title="点击查看详情！">{$value.order_num}</a></td>
                                                   
                                                    <td>{$value.coms}</td>
                                                    <td>{$value.address_id}</td>
                                                    <td>￥{$value.all_price}</td>
                                                    <td align="center"><a href="{$del}?payid={$value.id}"><button class="paydel">取消订单</button></a></td>
                                                </tr>
                                            <php>}</php>
                                        </foreach>    
                                    </tbody>
                                </table>
                                <div>&nbsp;</div>
                                <table class="table table-bordered table-striped table-condensed table-ed" style="display: none;">
                                    <thead>
                                    <tr><th colspan="6">已付款订单<a style="color: red;">（点击订单号查看详情）</a></th></tr>
                                    <tr>
                                        <th width="15%" align="center">订单号</th>
                                        <th width="25%" align="center">购买商品</th>
                                        <th width="20%" align="center">订单地址</th>
                                        <th width="10%" align="center">总价</th>
                                        <th width="10%" align="center">退款</th>
                                        <th width="10%" align="center">立即发货</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <foreach name="order" item="value">
                                            <php>if($value['status']==="已付款"){</php>
                                                <tr>
                                                    <td><a href="" alt="点击查看详情！" title="点击查看详情！">{$value.order_num}</a></td>
                                                    <td>{$value.coms}</td>
                                                    <td>{$value.address_id}</td>
                                                    <td>￥{$value.all_price}</td>
                                                    <td align="center"><a href="{$del}?payid={$value.id}"><button class="paybtn">退款</button></a></td>
                                                    <td align="center"><a href="{$pay}?payid={$value.id}"><button class="paybtn_on">立即发货</button></a></td>
                                                </tr>
                                            <php>}</php>
                                        </foreach>    
                                    </tbody>
                                </table>
                                <div>&nbsp;</div>
                                <table class="table table-bordered table-striped table-condensed table-past" style="display: none;">
                                    <thead>
                                    <tr><th colspan="6">无效订单<a style="color: red;">（点击订单号查看详情）</a></th></tr>
                                    <tr>
                                        <th width="20%" align="center">订单号</th>
                                        <th width="25%" align="center">购买商品</th>
                                        <th width="25%" align="center">订单地址</th>
                                        <th width="10%" align="center">总价</th>
                                        <th width="10%" align="center">状态</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <foreach name="order" item="value">
                                            <php>if($value['status']!=="已付款"&&$value['status']!=="待付款"){</php>
                                                <tr>
                                                    <td><a href="" alt="点击查看详情！" title="点击查看详情！">{$value.order_num}</a></td>
                                                    <td>{$value.coms}</td>
                                                    <td>{$value.address_id}</td>
                                                    <td>￥{$value.all_price}</td>
                                                    <td>{$value.status}</td>
                                                </tr>
                                            <php>}</php>
                                        </foreach>    
                                    </tbody>
                                </table>
                                <table border="2" style="border-collapse: collapse;border-color: gray;" class="table table-bordered table-striped table-condensed table-all">
                                    <thead>
                                    <tr><th colspan="6">所有订单<a style="color: red;">（点击订单号查看详情）</a></th></tr>
                                    <tr>
                                        <th width="20%" align="center">订单号</th>
                                        <th width="25%" align="center">购买商品</th>
                                        <th width="25%" align="center">订单地址</th>
                                        <th width="10%" align="center">总价</th>
                                        <th width="10%" align="center">状态</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <foreach name="order" item="value">
                                            <tr>
                                                <td><a href="" alt="点击查看详情！" title="点击查看详情！">{$value.order_num}</a></td>
                                                <td>{$value.coms}</td>
                                                <td>{$value.address_id}</td>
                                                <td>￥{$value.all_price}</td>
                                                <td>{$value.status}</td>
                                            </tr>
                                        </foreach>    
                                    </tbody>
                                </table>
                        </section>
                    </div>
                </section>
                {$page}
            </div>
        </div>
    </div>
<script type="text/javascript">
    $('.all').on('click',function(){
        $('#unseen').find('table').css('display','none');
        $('#unseen').find('.table-all').css('display','block');
    });
    $('.ing').on('click',function(){
        $('#unseen').find('table').css('display','none');
        $('#unseen').find('.table-ing').css('display','block');
    });
    $('.ed').on('click',function(){
        $('#unseen').find('table').css('display','none');
        $('#unseen').find('.table-ed').css('display','block');
    });
     $('.past').on('click',function(){
        $('#unseen').find('table').css('display','none');
        $('#unseen').find('.table-past').css('display','block');
    });

</script>
    <!--body wrapper end-->
<include file="Common@Backend/footer" />